package com.xingkeduo.model.vo;

import com.xingkeduo.model.po.TStaffAttendance;
import java.text.SimpleDateFormat;

public class CmsStaffAttendancePageVo {

    private Integer id;
    private String storeName;
    private Long staffId;
    private String staffName;
    private String staffNickName;
    private String date;
    private Byte type;
    private String startTime;
    private String endTime;
    private Integer workStatus;
    private Long modifier;
    private String modifierName;

    public CmsStaffAttendancePageVo() {
    }

    public CmsStaffAttendancePageVo(TStaffAttendance tStaffAttendance) {
        SimpleDateFormat dateDf = new SimpleDateFormat("yyyy-MM-dd");
        SimpleDateFormat timeDf = new SimpleDateFormat("HH:mm");
        Byte type = tStaffAttendance.getType();
        this.id = tStaffAttendance.getId();
        this.staffName = tStaffAttendance.getStaffName();
        this.staffId = tStaffAttendance.getStaffId();
        this.storeName = tStaffAttendance.getStoreName();
        this.workStatus = tStaffAttendance.getWorkStatus() == null ? null:tStaffAttendance.getWorkStatus();
        this.modifier = tStaffAttendance.getModifier() == null ? null : tStaffAttendance.getModifier();
        if(tStaffAttendance.getType() != null){
            this.type = tStaffAttendance.getType();
        }
        this.date = dateDf.format(tStaffAttendance.getDate());
        if(tStaffAttendance.getStartTime() != null && null != type){
            if(type == 1 || type == 2 || type == 3 || type == 8){
                this.startTime = dateDf.format(tStaffAttendance.getDate())+" "+timeDf.format(tStaffAttendance.getStartTime());
            }
        }else{
            this.startTime = "";
        }
        if(tStaffAttendance.getEndTime() != null && null != type){
            if(type == 1 || type == 2 || type == 3 || type == 8){
                this.endTime = dateDf.format(tStaffAttendance.getDate())+" "+timeDf.format(tStaffAttendance.getEndTime());
            }
        }else {
            this.endTime = "";
        }


    }

    public String getStaffName() {
        return staffName;
    }

    public void setStaffName(String staffName) {
        this.staffName = staffName;
    }

    public Byte getType() {
        return type;
    }

    public void setType(Byte type) {
        this.type = type;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public Integer getWorkStatus() {
        return workStatus;
    }

    public void setWorkStatus(Integer workStatus) {
        this.workStatus = workStatus;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Long getStaffId() {
        return staffId;
    }

    public void setStaffId(Long staffId) {
        this.staffId = staffId;
    }


    public String getStoreName() {
        return storeName;
    }

    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }

    public Long getModifier() {
        return modifier;
    }

    public void setModifier(Long modifier) {
        this.modifier = modifier;
    }

    public String getStaffNickName() {
        return staffNickName;
    }

    public void setStaffNickName(String staffNickName) {
        this.staffNickName = staffNickName;
    }

    public String getModifierName() {
        return modifierName;
    }

    public void setModifierName(String modifierName) {
        this.modifierName = modifierName;
    }
}
